package com.example.netty.chatSystem.channelService;

import io.netty.channel.Channel;

import java.util.Collection;
import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

public class ChannelService {
    private static ConcurrentHashMap<String, Channel> hashMap = new ConcurrentHashMap<>();
    private ChannelService(){};
    public static ConcurrentHashMap<String,Channel> getHashMap(){
        return hashMap;
    }

    public static void deleteChannel(Channel channel){
        Collection<Channel> values = hashMap.values();
        values.remove(channel);
    }
}
